package com.yesun.task.pipeline.handler;

import com.yesun.task.pipeline.common.Constant;
import com.yesun.task.pipeline.domain.dto.JobDto;
import com.yesun.task.pipeline.handler.impl.*;

/**
 * @Author yesun
 * @Descritpion
 * @Date 2023/8/16 22:21
 * @Version 1.0
 **/
public class HandlerFactory {

    public static Handler getHandler(JobDto jobDto) {
        if(jobDto.getTag().equals(Constant.JOB_TAG_ZJLR)) { //资金流入
            return new ZjlrHandler(jobDto);
        } else if (jobDto.getTag().equals(Constant.JOB_TAG_DETAIL)) { //分时分笔
            return new DetailHandler(jobDto);
        }  else if (jobDto.getTag().equals(Constant.JOB_TAG_RT_DETAIL)) { //分时分笔
            return new RtDetailHandler(jobDto);
        } else if (jobDto.getTag().equals(Constant.JOB_TAG_HOT)) { //人气榜
            return new HotHandler(jobDto);
        } else if (jobDto.getTag().equals(Constant.JOB_TAG_PYTHON)) { //python etl
            return new PythonHandler(jobDto);
        } else if (jobDto.getTag().equals(Constant.JOB_TAG_DAY)) { //每日交易数据
            return new DayHandler(jobDto);
        } else if (jobDto.getTag().equals(Constant.JOB_TAG_BASE)) { //股票基础数据
            return new BaseHandler(jobDto);
        } else if (jobDto.getTag().equals(Constant.JOB_TAG_TEST)) { //TEST
            return new TestHandler(jobDto);
        } else if (jobDto.getTag().equals(Constant.JOB_TAG_FINANCE)) { //财务数据
            return new FinanceHandler(jobDto);
        } else if (jobDto.getTag().equals(Constant.JOB_TAG_HOLDER)) { //股东人数
            return new HolderHandler(jobDto);
        } else if (jobDto.getTag().equals(Constant.JOB_TAG_LIFT_BAN)) {
            return new LiftBanHandler(jobDto);
        } else if (jobDto.getTag().equals(Constant.JOB_TAG_DF_IMPORTANT_NEWS)) {
            return new DfNewsHandler(jobDto);
        } else if (jobDto.getTag().equals(Constant.JOB_TAG_DF_QUICK_NEWS)) {
            return new DfQuickNewsHandler(jobDto);
        } else if (jobDto.getTag().equals(Constant.JOB_TAG_LONGTOU)) {
            return new LongtouHandler(jobDto);
        }
        return null;
    }


}
